import { render, createVNode } from 'vue'

import Message from './message.vue'

export function message ({ type, text }) {
  const newNode = createVNode(Message, { type, text })

  const container = document.createElement('div')

  document.body.appendChild(container)

  render(newNode, container)

  setTimeout(() => {
    container.remove(newNode)
  }, 1500)
}
